var countPrimes = function (n) {
    let count = 0;
    for(var i = 2;i < n;i++){
        var a = isPrimes(i)
        if(a) count++
    }
    return count

    function isPrimes (s) {
        for(var i = 2;i < s;i++){
            if(s % i == 0){
                return true
            }
        }
        return false
    }
}

var b = countPrimes(3)
console.log(b);

